import unittest
import requests
from api.api import Api


class TestApi(unittest.TestCase):
    def setUp(self) -> None:
        self.session = requests.session()
        self.api = Api(self.session)

    def tearDown(self) -> None:
        self.session.close()

    def test_list(self):
        # 注册图片验证
        self.api.get_register_Login_api.api_img_code(123)
        # 注册短信验证码
        r = self.api.get_register_Login_api.api_phone_code("13600001114","8888")
        # 注册
        self.api.get_register_Login_api.api_register("13600001114","test123","8888","666666")
        # 登录
        r = self.api.get_register_Login_api.api_login("13600001114","test123")
        print(r.json())
